﻿using System;
using System.Collections.Generic;
using System.Text;

namespace NeuralNetwork
{
    public class Helpers
    {
        public static float[][] MakeMatrix(int rows, int cols)
        {
            float[][] result = new float[rows][];
            for (int i = 0; i < rows; ++i)
                result[i] = new float[cols];
            return result;
        }
        public static float Error(float[] tValues, float[] yValues)
        {
            double sum = 0.0;
            for (int i = 0; i < tValues.Length; ++i)
                sum += (tValues[i] - yValues[i]) * (tValues[i] - yValues[i]);
            return (float)Math.Sqrt(sum);
        }
    }
}
